package com.smarthome.domain.ipc;

public enum IpcCodeEnum {

	COMMAND_NOT_FOUND("command_not_found", "命令没找到"), 
	PARM_NOT_VALID("parm_not_valid","非法参数"), 
	SYSTEM_ERROR("system_error","系统错误"), 
	SYSTEM_SUCCESS("ok", "执行成功");

	private String code;
	private String msg;

	private IpcCodeEnum(String code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	public static IpcCodeEnum getByCode(String code) {
		for (IpcCodeEnum subEnum : values()) {
			if (subEnum.getCode().equals(code)) {
				return subEnum;
			}
		}
		throw new IllegalArgumentException("none-defined IpcCodeEnum,code:" + code);
	}

}
